package org.kmfdm.horrorscope.metamodel.beans;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;



import org.kmfdm.horrorscope.metamodel.Chart;
import org.kmfdm.horrorscope.metamodel.Customer;
import org.kmfdm.horrorscope.metamodel.User;
@Entity
public class CustomerBean extends UserBean implements Customer {

	
	
	private String aboutMe;
	private String occupation;
	//private List<Rating> myRatings;
	private List<Chart> myCharts=new ArrayList<Chart>();
	private String interest;
	
	@Basic
	public String getAboutMe() {
		return aboutMe;
	}
	
	public void setAboutMe(String aboutMe) {
		this.aboutMe = aboutMe;
	}
	@Basic
	public String getOccupation() {
		return occupation;
	}
	
	public void setOccupation(String occupation) {
		this.occupation = occupation;
	}
	@OneToMany(mappedBy="owner",
	cascade = {CascadeType.ALL},
	targetEntity=ChartBean.class)
	public List<Chart> getMyCharts() {
		return myCharts;
	}
	
	public void setMyCharts(List<Chart> myCharts) {
		this.myCharts = myCharts;
	}
	@Basic
	public String getInterest() {
		return interest;
	}
	
	public void setInterest(String interest) {
		this.interest = interest;
	}

	public void addChart(Chart c) {
		c.setOwner(this);
		myCharts.add(c);
		
	}

	public void removeChart(Chart c) {
		c.setOwner(null);
		myCharts.remove(c);
	}
	
}
